//
//  Method3View.swift
//  corner_shadow
//
//  Created by 李煜 on 2024/5/14.
//

import UIKit

class Method3View: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)

        setupViews()
    }

    required init?(coder: NSCoder) {
        super.init(coder: coder)
        setupViews()
        fatalError("init(coder:) has not been implemented")
    }

    private func setupViews() {
//        shadow()
//        roundedCorner()
    }
    func roundedCorner() {
        backgroundColor = .red
        // 设置圆角
        layer.cornerRadius = 8
        layer.masksToBounds = false
    }
    func shadow() {
        layer.shadowColor = UIColor.black.cgColor
        layer.shadowOffset = CGSize(width: 2, height:2)
        layer.shadowRadius = 8;
        layer.shadowOpacity = 0.5
        layer.masksToBounds = false
    }
}

@available(iOS 17.0, *)
#Preview {
    ViewController()
}
